package com.aaa.dao.impl;

import com.aaa.dao.DeptDao;
import com.aaa.utils.BaseDao;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author ：Teacher陈（86521760@qq.com）
 * @date ：Created in 2022/8/9 9:17
 * @description：用户dao实现类
 * @modified By：
 * @version: 1.0
 */
@Repository
public class DeptDaoImpl extends BaseDao  implements DeptDao {
    @Override
    public List<Map<String, Object>> queryAll(Map map) {
        StringBuffer sql=new StringBuffer("select * from dept where 1=1 ");

        System.out.println("sql："+sql);
        return executeQuery(sql.toString());
    }

    @Override
    public Long queryCount(Map map) {
        StringBuffer sql=new StringBuffer("select count(*) mycount from dept where 1=1 ");
        List<Map<String, Object>> mapList = executeQuery(sql.toString());
        return Long.parseLong(mapList.get(0).get("mycount")+"");
    }
}
